﻿using ConfExpert.Forms.Base;
using ConfExpert.Utility;
using DevExpress.XtraEditors.Repository;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Extensions;

using DevTeamIT;

namespace ITaskManager.Forms.IT
{
    public partial class EnvanterListe : XForm
    {
        public EnvanterListe()
        {
            InitializeComponent();
        }

        private void Envanter_Load(object sender, EventArgs e)
        {
            gvNotebook.Init("IT_GetEnvanter", Session.SirketId, Session.CurrentUser.UserId);
            gvNotebook.Columns["IT_LokasyonId"].ColumnEdit = RepositoryManager.riEL;
            gvNotebook.Columns["IT_AlanId"].ColumnEdit = RepositoryManager.riEA;
            gvNotebook.Columns["IT_EnvanterCesitId"].ColumnEdit = RepositoryManager.riEC;
            gvNotebook.SetCaptions("IT_AlanId:Alan", "IT_LokasyonId:Lokasyon");
            gvNotebook.SetIdentity("IT_EnvanterId");
            gvSunucular.Init("");
            gvYazicilar.Init("");
            gvAktifCihazlar.Init("");
            gvNotebook.BestFitColumns();
            gvSunucular.BestFitColumns();
            gvYazicilar.BestFitColumns();
            gvAktifCihazlar.BestFitColumns();

            btnKaydet.ItemClick += btnKaydet_ItemClick;
        }

        void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gvNotebook.EndEdit();
            gvNotebook.Update("", "IT_Envanter");
            gvSunucular.EndEdit();
            gvSunucular.Update("","");
            gvYazicilar.EndEdit();
           
        }
    }
}
